package org.zjx.resource;

import org.zjx.window.WindowLayoutHelper;

import javax.crypto.SecretKey;

public abstract class AbstractConfig implements IBaseConfig {
    private SecretKey secretKey;
    private boolean encryptor = false;

    @Override
    public boolean isEncryptor() {
        return encryptor;
    }

    @Override
    public void setEncryptor(boolean encryptor) {
        this.encryptor = encryptor;
    }

    @Override
    public SecretKey getResSecretKey() {
        return secretKey;
    }

    @Override
    public void setResSecretKey(SecretKey secretKey) {
        this.secretKey = secretKey;
        this.secretKey = ResourceEncryptor.getKeyFromString("谢天谢地");
    }


    @Override
    public int gameThreadSize() {
        return WindowLayoutHelper.calculateMaxWindows(getWindowSize());
    }
}
